class Message < ActiveRecord::Base
  belongs_to :user, :class_name=>"User", :counter_cache => "outbox_count"
  belongs_to :mgser, :class_name=>"User", :foreign_key => "mgser_id", :counter_cache => "inbox_count"
  def before_create
    self.created_at = Time.now
  end
end
